package org.rendao.auth.service.impl;

import java.util.List;

import org.rendao.auth.data.UserRoleDO;
import org.rendao.auth.model.UserRole;
import org.rendao.auth.service.UserRoleService;
import org.rendao.dao.IGenericDao;
import org.rendao.utils.AssembleUtils;

public class UserRoleServiceImpl implements UserRoleService {

	private IGenericDao<UserRoleDO> dao;

	public void setDao(IGenericDao<UserRoleDO> daoToSet) {
		dao = daoToSet;
		dao.setClazz(UserRoleDO.class);
	}
	
	@Override
	public List<UserRole> getAll() {
		List<UserRoleDO> roles = dao.getAllAvailable();
		return AssembleUtils.shadowCopyList(roles, UserRole.class);
	}

}
